import Layout from '../views/layout/Layout'

const _import = require('./_import_' + process.env.NODE_ENV);
var AppComponent = {
  template: '<router-view/>'
}
export default {
  path: '/invoive',
  component: Layout,
  name: 'invoive',
  meta: {title: '电子发票', icon: 'icon'},
  children: [
    {
      path: 'tax',
      component: _import('invoive/tax/list'),
      name: 'invoiveTax',
      meta: {
        title: '类目分类',
        buttons: {
          add: { label: '新建', enabled: true },
          edit: { label: '编辑', enabled: true }
        }
      },
    },
    {
      path: 'notifyConfiguration',
      component: _import('invoive/tax/notifyConfiguration'),
      name: 'notifyConfiguration',
      meta: {
        title: '红冲失败通知配置'
      },
    },
    {
        path: 'contractingParty',
        component: _import('invoive/contractingParty/list'),
        name: 'contractingParty',
        meta: {
            title: '合同签约方',
            buttons: {
                add: { label: '新建', enabled: true },
                edit: { label: '编辑', enabled: true },
                export: { label: '导出', enabled: true },
                delete:{label: '删除', enabled: true}
            }
        }
    },
    {
    path: 'contractingParty/add',
      component: _import('invoive/contractingParty/edit'),
      name: 'contractingPartyAdd',
      meta: {
        title: '新建合同签约方',
      },
      hidden: true
    },
    {
      path: 'contractingParty/edit',
      component: _import('invoive/contractingParty/edit'),
      name: 'contractingPartyEdit',
      meta: {
        title: '编辑合同签约方',
        noCache: true
      },
      hidden: true
    },
    {
      path: '/electronicInvoice',
      component: AppComponent,
      // redirect: 'electronicInvoice/manage',
      name: 'electronicInvoice',
      meta: {
        title: '电子发票'
      },
      children: [
        {
          path: 'manage',
          component: _import('invoive/electronicInvoice/manage'),
          name: 'electronicInvoiceManage',
          meta: {
            title: '电子发票管理',
            buttons: {
              search: { label: '查询', enabled: true },
              export: { label: '导出', enabled: true },
              apply: { label: '红冲申请', enabled: true },
              detail: { label: '查看详情', enabled: true }
              // redRush: { label: '红冲', enabled: true }
            }
          }
        },
        {
          path: 'redRush',
          component: _import('invoive/electronicInvoice/redRush'),
          name: 'electronicInvoiceRedRush',
          meta: {
            title: '红冲申请',
            buttons: {
              // import: { label: '导入', enabled: true },
              export: { label: '导出', enabled: true },
              // delete: { label: '作废', enabled: true }
              // del: { label: '作废', enabled: true }
            }
          }
        },
        // {
        //   path: 'finish',
        //   component: _import('invoive/electronicInvoice/finish'),
        //   name: 'electronicInvoiceFinish',
        //   meta: {
        //     title: '已开发票',
        //     buttons: {
        //       export: { label: '导出', enabled: true }
        //     }
        //   }
        // },
        // {
        //   path: 'fail',
        //   component: _import('invoive/electronicInvoice/fail'),
        //   name: 'electronicInvoiceFail',
        //   meta: {
        //     title: '开票失败',
        //     buttons: {
        //       return: { label: '退回', enabled: true },
        //       reSubmit: { label: '重新提交', enabled: true },
        //       export: { label: '导出', enabled: true }
        //     }
        //   }
        // },
        {
          path: 'message',
          component: _import('invoive/electronicInvoice/message'),
          name: 'electronicInvoiceMessage',
          meta: {
            title: '信息通知',
            buttons: {
              search: { label: '查询', enabled: true }
            }
          }
        },
        {
          path: 'status',
          component: _import('invoive/electronicInvoice/status'),
          name: 'electronicInvoiceStatus',
          meta: {
            title: '全局参数',
            buttons: {
              open: { label: '开启', enabled: true },
              close: { label: '关闭', enabled: true }
            }
          }
        }
      ]
    },
    {
      path: 'electronicInvoice/wait',
      component: _import('invoive/electronicInvoice/wait'),
      name: 'electronicInvoiceWait',
      meta: {
        title: '发票申请单',
        buttons: {
          new: { label: '新建', enabled: true },
          apply: { label: '红冲申请', enabled: true },
          // delete: { label: '删除', enabled: true },
          edit: { label: '编辑', enabled: true }

        }
      }
    },
  ]
}
